package com.plug.common.quartz.job;

import com.plug.common.jdbc.DBConnectionManager;
import com.plug.common.spring.utils.ApplicationContextHelper;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Date;

/**
 * Created by slayes on 2017/1/16.
 */
public class QuartzJob implements Job {

    private Logger logger = LoggerFactory.getLogger(getClass());

    private DBConnectionManager dbConnectionManager = DBConnectionManager.getInstance();

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        System.out.println("----------------" + context.getJobDetail().getKey().getName() + "-------------------");
        System.out.println("----------任务执行时间------" + new Date() + "-------------------");
        logger.debug("--------spring------{}-------------------------", ApplicationContextHelper.getApplicationContext());

    }
}
